﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using LM.Negocio.Objetos;

namespace LM.Repositorios.Maps
{
    public class LocacaoMap : EntityTypeConfiguration<Locacao>
    {
        public LocacaoMap()
        {
            this.HasKey(m => m.Id);
            this.Property(m => m.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).HasColumnName("Id");

            this.Property(c => c.Codigo).HasColumnName("Codigo").IsRequired();
            this.Property(c => c.DataEntrada).HasColumnName("Entrada").IsRequired();
            this.Property(c => c.DataSaida).HasColumnName("Saida").IsRequired();
            this.Property(c => c.Status).HasColumnName("Status").IsRequired();
            this.Property(c => c.Total).HasColumnName("Total");
            this.Property(c => c.Desconto).HasColumnName("Desconto").IsRequired();

            this.ToTable("LOCACAO");
        }
    }
}
